package org.zxp.onedoteight.lambda;

import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @program: effectiveJava
 * @description:
 * @author: X-Pacific zhang
 * @create: 2020-12-10 10:16
 **/
public class LambdaException {
    public static void main(String[] args){
        System.out.println("lambda执行前");
        Arrays.asList("1","2","3","4")
                .stream().forEach(s -> {
                    System.out.println(s);
                    if(s.equals("3")){
                        throw new RuntimeException("lambda test error");
                    }
        });
        System.out.println("lambda执行后");
    }
}
